import {Avatar, Box, Dropdown, Static} from '../components'
import {CurrentUser} from '../graphql'
import Router from 'next/router'

export default () => (
    <Box>
        <CurrentUser render={({currentUser}) => (
            <Box height='100%' flex='flex' justify='flex-end' width='100%'>
                <Avatar icon='user'/>
                <Static color='#fff' style={{margin: '0 .5rem'}}/>
                <Dropdown title={currentUser.name}
                          onClick={({key}) => Router.push(key)}
                          items={[
                              {key: '/share/reset-password', name: '修改密码'},
                              {key: '/', name: '退出'}
                          ]}
                />
            </Box>
        )}/>
    </Box>
)